require 'piston/plugin/edit/command/open_file'

module Piston
  class Plugin
    def view(xaml_builder)
      puts xaml_builder
    end

    def after_build(win)
      xaml_file = File.join(File.expand_path(File.dirname(__FILE__)), 'view/edit.xaml')
      document = System::Windows::Markup::XamlReader.load_file xaml_file
      #doc_pane = win.find_name('layoutPanel')
      #doc_pane.children.add document
      
      workspace = Piston::Workspace.instance
      workspace.file_view.add document
    end
  end
end